/**
 * Created by RickyTT on 14-1-27.
 */
var Crypto = require('crypto');

exports.MD5 = function md5 (text) {
    return Crypto.createHash('md5').update(text).digest('base64');
};


exports.isEmail = function isEmail(str){
    if (eregi("^[0-9a-z][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}[0-9a-z]\.){1,4}[a-z]{2,4}$", str))
        return true;
    else
        return false;

}